package com.longai.model;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

/**
 * Newscomment entity. @author MyEclipse Persistence Tools
 */
@Entity
@Table(name = "newscomment", catalog = "longai")
public class Newscomment implements java.io.Serializable {

	// Fields

	private Integer newscommentId;
	private News news;
	private User user;
	private String commentContet;
	private Long pubtime;

	// Constructors

	/** default constructor */
	public Newscomment() {
	}


	// Property accessors
	@Id
	@GeneratedValue
	@Column(name = "newscomment_id", unique = true, nullable = false)
	public Integer getNewscommentId() {
		return this.newscommentId;
	}

	public void setNewscommentId(Integer newscommentId) {
		this.newscommentId = newscommentId;
	}

	@ManyToOne(fetch = FetchType.EAGER)
	@JoinColumn(name = "news_id")
	public News getNews() {
		return this.news;
	}

	public void setNews(News news) {
		this.news = news;
	}

	@ManyToOne(fetch = FetchType.EAGER)
	@JoinColumn(name = "user_id")
	public User getUser() {
		return this.user;
	}

	public void setUser(User user) {
		this.user = user;
	}

	@Column(name = "comment_contet", length = 200)
	public String getCommentContet() {
		return this.commentContet;
	}

	public void setCommentContet(String commentContet) {
		this.commentContet = commentContet;
	}

	@Column(name = "pubtime")
	public Long getPubtime() {
		return this.pubtime;
	}

	public void setPubtime(Long pubtime) {
		this.pubtime = pubtime;
	}

}